-
Notifications
You must be signed in to change notification settings - Fork 0
Add send benchmark #238
base: master
Are you sure you want to change the base?
Add send benchmark #238
Conversation
Copy from `~buczek/src/small/send.c`.
Fix the warnings below: $ make send cc send.c -o send send.c:41:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main(int argc,char *argv[]) { ^~~~ send.c: In function ‘main’: send.c:63:5: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] memset(buffer,0xA3,sizeof(buffer)); ^~~~~~ send.c:63:5: warning: incompatible implicit declaration of built-in function ‘memset’ send.c:63:5: note: include ‘<string.h>’ or provide a declaration of ‘memset’ send.c:79:5: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration] memcpy(&sin.sin_addr,he->h_addr,he->h_length); ^~~~~~ send.c:79:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ send.c:79:5: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’ Reported-by: gcc (GCC) 7.5.0
Build with `make send`, add it to the git archive, and install it to `/usr/bin`.
Currently, negative benchmark values are shown: @ira$ send okeanos 34141 start : 1647613816.868339 close : 1647613826.868524 done : 1647613826.874427 -1209148824 bytes in 10.006088 seconds -120841314.207910 bytes / seconds -966730513.663282 bits / seconds -966730.513663 kBit/s / seconds -966.730514 MBit/s / seconds With 10 Gbit/s, in 10 s seconds theoretically up to 12.5 GB could be transferred. But a 32-bit (signed) integer can at maximum store the number (2147483648 - 1), and the unsigned integer around 4.3 million, still too small. Therefore, use unsigned long to be able to store the number bytes without overflow for the foreseeable future. Now we have: @ira$ ./send okeanos 34141 start : 1647626064.313421 close : 1647626074.313503 done : 1647626074.317791 10534190976 bytes in 10.004370 seconds 1052958954.536867 bytes / seconds 8423671636.294939 bits / seconds 8423671.636295 kBit/s / seconds 8423.671636 MBit/s / seconds Resolves: mariux64/mariux64-issues#23
d5e69bb
to
08e1a93
Compare
I know suggested to import this to mxtools but I didn't realize, that this needs to be compiled. We had this before and reverted it it (#135). For that it was suggested to check in the binary as well, as you did here, but I didn't like the idea. Do you? Is the last commit ("Make byteCount unisgned long") in the binary? |
I wouldn’t say I like it. It’s not very elegant, but solves our problem and improves the current situation. I have no problem making it a separate repository, but having to create a new release and doing the bee dance each time, is maybe also quite time consuming compared to the fact, that it’s as small tool infrequently used. But discussing it, takes probably more time than choosing any of the two options.
Yes, I rebuilt the binary with that change, and committed it. |
Okay, than lets try it this way. Is "send" as a public command to generic? |
nope. i like it 8-) |
okay with me. |
91ee9fc
to
647c337
Compare
Add @donald’s benchmark to measure the bandwidth between two systems.
Receiver:
Sender: